package com.yiwyn.Behavioral.cor.pro.handle;

import com.yiwyn.Behavioral.cor.pro.domain.Contract;
import com.yiwyn.Behavioral.cor.pro.exception.CtrctException;
import com.yiwyn.Behavioral.cor.pro.handle.base.AbstractContractHandle;

import java.util.HashMap;

public class VariableHandle implements AbstractContractHandle {

    private static VariableHandle instance;

    public static VariableHandle getInstance() {
        if (instance == null) {
            return new VariableHandle();
        }
        return instance;
    }


    @Override
    public void doHandle(Contract contract) throws CtrctException {
        HashMap<String, String> variable = new HashMap<>();
        variable.put("sign", "ywiyn");
        variable.put("date", "2000/01/01");
        contract.setVariable(variable);
        throw new CtrctException("合同要素组装失败");
    }
}
